import { network } from '@/utils';

import { basic, address, logisCenter,partner } from '../../config/Apis';

export async function queryAliasList(params: any) {
  return network.get(basic.express_expressAnother, { params });
}

export async function queryGardenType(params: any) {
  return network.get(basic.code_gardenType, { params });
}

export async function queryPropertyList(params: any) {
  return network.get(basic.property_list, { params });
}

export async function queryAllPropertyList(params: any) {
  return network.get(basic.property_allList, { params });
}

export async function queryAreaList(params: any) {
  return network.get(basic.area_list, { params });
}

export async function queryAddressList() {
  const timestamp3 = new Date().getTime();
  return network.address(`${address}?v=${timestamp3}`);
}

export async function queryPasswordType(params: any) {
  return network.get(basic.other_passwordType, { params });
}

export async function queryAllOrgList(params: any) {
  return network.get(basic.org_list, { params });
}

export async function querySelectOrgList(params: any) {
  return network.get(basic.org_lowerList, { params });
}

export async function queryGardenList(params: any) {
  return network.get(basic.garden_userGardenList, { params });
}

export async function queryFranchiseeList(params: any) {
  return network.get(basic.other_franchisee_list, { params });
}

export async function queryTariffList(params: any) {
  return network.get(basic.cab_tariff_selectList, { params });
}

export async function queryExpressList(params: any) {
  return network.get(basic.express_list, { params });
}

export async function queryLogisList(params: any) {
  return network.get(basic.logis_allList, { params });
}

export async function queryCheckPerm(params: any) {
  return network.get(basic.menu_checkMenu, { params });
}

export async function queryPartnerCompany(params: any) {
  return network.get(basic.express_partnerCompany, { params });
}

export async function queryAuthUserList(params: any) {
  return network.get(basic.other_authUserList, { params });
}

// 以下为物流中心公共接口

export async function queryGardenList2(params: any) {
  return network.get(logisCenter.garden_list, { params });
}

export async function queryShelfList(params: any) {
  const dataSource: any[] = [];

  for (let i = 0; i < 10; i += 1) {
    dataSource.push({
      key: i,
      id: 123 + i,
      name: `名称${i + 1}`,
      logisId: 111,
      logisName: '',
      code: '',
      addr: '',
    });
  }

  const result = {
    code: 0,
    message: 'success',
    body: dataSource,
  };

  // return result;
  return network.get(logisCenter.shelf_list, { params });
}

export async function queryCabinetList(params: any) {
  return network.get(logisCenter.cabinet_list, { params });
}

export async function queryExpressList2(params: any) {
  return network.get(logisCenter.express_list, { params });
}

export async function queryProblemTypeList(params: any) {
  return network.get(logisCenter.order_problem, { params });
}

export async function queryAuthCheckPerm(params: any) {
  return network.get(logisCenter.auth_checkPerm, { params });
}

// 新增街道信息
export async function queryStreetList(params: any) {
  return network.get(basic.area_list, { params });
}

// 获取业务类型
export async function queryBizType(params: any) {
  return network.get(partner.business_type, { params });
}

// 获取用户类型
export async function queryPayType(params: any) {
  return network.get(partner.user_type, { params });
}

// 设备类型
export async function queryDeviceType(params: any) {
  return network.get(partner.device_type, { params });
}

// 退回原因
export async function queryWithdrawReasonList(params: any) {
  return network.get(logisCenter.order_withdraw_reason, { params });
}

// 获取快递单图片
export async function queryOrderImg(params: any) {
  return network.get(logisCenter.order_img, { params });
}
